<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8" />
    <title>Document</title>
    <style></style>
  </head>
  <body>
    <div>剩余参数</div>
    <script>
      //以前用arguemnts,但arguments是一个伪数组
      function foo(...args) {
        console.log(args); //数组(6) [1, 2, 3, 4, 5, 6]
        console.log(...args); //1 2 3 4 5 6
      }

      foo(1, 2, 3, 4, 5, 6);
    </script>
  </body>
</html>
